********************************************************************************
** Table 1: Balance (High Hopes)
********************************************************************************

set more off
use "$merge_mobile", clear 


**Defining globals/variables for Panel A, B and C of the balance table
global respondent_varlist gender resp_primarydecisionmaker decisionmaker_male primaryormore secondaryormore formaljob spouse_formal mpesastatus  mshwari_before mobile_balance_june30

global children_varlist numberofchildreninhousehold  public_boarding schoolexpensesexpected  priorsecondaryschoolattendance financingoptions1_5

global school_varlist pupiltoteacherratio secschoolenroll


*Exporting 
orth_out  $respondent_varlist using "$output/Table_01_Balance.xls", ///
	by(treatment_arm) test stars se count vce(cluster schoolname_baseline_encoded) compare overall bdec(2) ///
	title(HH Panel A: Respondent) replace 

orth_out $children_varlist using "$output/Table_01_Balance.xls", vappend ///
	by(treatment_arm) test stars se count vce(cluster schoolname_baseline_encoded) compare overall bdec(2) ///
	title(HH Panel B: Children & Schooling) replace 

	 
keep permanentclassroomsusable ageofschool enrollmenttotal pupiltoteacherratio ///
		secschoolenroll treatment_arm  schoolname_baseline_encoded 
 
duplicates drop 
count 
assert `r(N)'==331 //number of unique schools in our sample
		
orth_out $school_varlist using "$output/Table_01_Balance.xls", vappend ///
	by(treatment_arm) test stars se count vce(cluster schoolname_baseline_encoded) compare overall bdec(2) ///
	title(HH Panel C: Schools) replace 


exit 	

Notes: Sample restricted to those with baseline and ADS consent. Robust standard errors clustered at school level. *** significant at 1%, ** significant at 5%, * significant at 10%. Gross mobile balance is defined as total M-PESA balance plus any M-Shwari bank accounts owned. Covariates in italics predict secondary school enrollment in a cross validated LASSO regression run on the control group only.









